package com.sz.stock.controller;

import com.sz.stock.model.ResultBean;
import com.sz.stock.model.StockBuyOrSale;
import com.sz.stock.service.IBuyOrSaleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/bos")
public class BuyOrSaleController {

    private IBuyOrSaleService buyOrSaleService;

    @Autowired
    public void setBuyOrSaleService(IBuyOrSaleService buyOrSaleService) {
        this.buyOrSaleService = buyOrSaleService;
    }

    @RequestMapping("/getfive")
    public ResultBean getFive(String code, String type){
        System.out.println(type);
        String str = code.substring(2);
        List<StockBuyOrSale> list = buyOrSaleService.getFive(str, type);
        return new ResultBean(0,"查询成功!",list);
    }
}
